<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>老竹园 - 轮播图</title>
    <!-- <link rel="stylesheet" href="styles.css"> -->
    <link rel="stylesheet" href="base.css">
    <script src="../js/animate.js"></script>
    <script src="../js/index.js"></script>
    <style>
        /* 全局样式 */
        body {
            margin: 0 auto;
            box-sizing: border-box;
            list-style: none;
        }

        a {
            text-decoration: none;
            color: #333;
        }

        /* 双伪元素清除法 */
        .clearfix::before,
        .clearfix::after {
            content: "";
            display: table;
        }

        .clearfix::after {
            clear: both;
        }

        /* 导航栏样式 */
        .navbar {
            height: 50px;
            width: 1520px;
            background-color: ghostwhite;
        }

        .navbar .logo img {
            height: 50px;
            width: 10%;
            float: left;
        }

        .navbar .nav-links {
            margin-left: 22%;
            width: 30%;
            float: left;
            margin-top: 16px;
        }

        .navbar .nav-links li {
            float: left;
            margin-left: 5%;
            font-size: 18px;
            line-height: 20px;
        }

        .user-buttons {


            margin-left: 90%;
            margin-top: 10px;
        }

        .user-buttons button {
            font-size: 20px;
            line-height: 30px;
            background-color: green;
            margin-right: 10px;
            margin-top: 8px;
        }

        .dropdown-menu li {
            display: block;
            width: 100%;
            text-align: left;
            padding: 5px 0;
        }

        /* 轮播图样式 */
        .slideshow-container {
            margin-top: 30px;
            position: relative;
            height: 280px;
            width: 1520px;
        }

        .slideshow-container img {
            display: block;
            width: 1520px;
            height: 280px;
        }

        #wrapper {
            width: 1480px;
            height: 500px;
            position: relative;
            overflow: hidden;
        }

        #wrapper ul {
            width: 600%;
            margin: 0;
            padding: 0;
            position: absolute;
        }

        #wrapper ul li {
            float: left;
        }




        .prev,
        .next {
            position: absolute;
            top: 200px;
            width: 45px;
            height: 45px;
            background-image: url(../image/sprites.png);
            background-color: rgba(0, 0, 0, .8);
            border-radius: 50%;
            /* 隐藏 */
            display: none;
            z-index: 5;
        }

        .prev {
            left: 20px;
            background-position: 14px -60px;
        }

        .next {
            right: 20px;
            background-position: -23px -60px;
        }

        .wrapper {
            width: 1600px;
            position: relative;
            margin: 0 auto;
        }

        .wrapper img {
            float: left;
            height: 350px;
            width: 1480px;
            box-sizing: border-box;

        }

        #wrapper ol {
            position: absolute;
            height: 10px;
            left: 555px;
            top: 315px;
        }

        #wrapper ol li {
            float: left;
            height: 15px;
            width: 15px;
            margin-right: 24px;
            background-color: white;
            border-radius: 50px;
            cursor: pointer;
        }

        #wrapper ol .current {
            background-color: yellow;
        }




        /* 书籍展示样式 */
        .book-display {
            height: 400px;
            width: 1520px;
            box-sizing: border-box;
            margin: 100px 0px;
            padding: 10px;
        }
        .book-display .book h3 {
            text-align: left;
        }

        .book {
            float: left;
            height: 280px;
            width: 48%;
            box-sizing: border-box;
            margin-left: 30px;
        }

        .book p {
            text-align: left;
            color: black;
            font-size: 18px;
            line-height: 25px;
            font-weight: 600px;}

        .book img {
            height: 390px;
            width: 40%;
            float: left; }

        .content {
            float: left;
            width: 45%;
            height: 390px;
            background-color: rgb(255, 249, 249);
        }

        /* 页脚样式 */
        .footer {
            background-color: #333;
            color: #fff;
            padding: 20px;
            width: 1520px;
        }

        .footer p {
            color: #999;
            font-size: 18px;
        }

        strong {
            color: red;
        }

        .content button {
            font-size: 20px;
            float: left;
            width: 100%;
            height: 40px;

            background-color: green;
        }
    </style>

</head>

<body>
    <!-- 导航栏 -->
    <div class="navbar">
        <div class="logo">
            <img src="../image/logo.png" alt="老竹园">
        </div>
        <ul class="nav-links" type="none">
            <li><a href="#">首页</a></li>
            <li class="dropdown">
                <a href="#">资源下载</a>
                <ul class="dropdown-menu">
                    <li><a href="#">教案</a></li>
                    <li><a href="#">PPT</a></li>
                    <li><a href="#">试卷</a></li>
                    <li><a href="#">习题</a></li>
                </ul>
            </li>
            <li><a href="#">资源上传</a></li>
            <li><a href="#">联系我们</a></li>
        </ul>
        <form action="2.html">
            <div class="user-buttons">
                <button>登录</button>
                <button type="submit" id="register-btn">注册</button>
            </div>
        </form>
    </div>
    <!-- 轮播图 -->
    <div class="slideshow-container">
        <div class="wrapper" id="wrapper">
            <ul id="ul">
                <li><a href=""><img src="../image/6.jpg" alt=""></a></li>
                <li><a href=""><img src="../image/15.jpg" alt=""></a></li>
                <li><a href=""><img src="../image/14.jpg" alt=""></a></li>
                <li><a href=""><img src="../image/13.jpg" alt=""></a></li>
            </ul>
            <!-- 箭头 -->
            <a href="javascript:;" class="prev"></a> <!-- prev:上一个 -->
            <a href="javascript:;" class="next"></a> <!-- next :下一个 -->
            <!-- 圆点 -->
            <ol></ol>
        </div>
        <a href="javascript:;" class="prev"></a>
        <!-- next :下一个 -->
        <a href="javascript:;" class="next"></a>
    </div>

    <!-- 书籍展示 -->
    <div class="book-display">
        <!-- 书籍1 -->
        <div class="book">
            <img src="../image/4.jpg" alt="">
            <div class="content">
                <h3>
                    数据结构 从概念到C实现 第二版
                </h3>
                <p>作者: 王红梅</p>
                <p>出版社:清华大学出版社</p>
                <p>出版时间:2023-04-01</p>
                <p>定价: <strong>34.5</strong></p>
                <p>推荐语:本书内容丰富,层次清晰,深入浅出,结合实例,可作为高等学校计算机及相关专业数据结构课程的教材,也可供从事计算机软件开发和应用的工程技术人员阅读和参考.
                </p>
                <button>Buy Now</button>
            </div>
        </div>
        <!-- 书籍2 -->
        <div class="book">
            <img src="../image/5.jpg" alt="">
            <div class="content">
                <h3>
                    算法分析与设计 第3版
                </h3>
                <p>作者: 王红梅</p>
                <p>出版社:清华大学出版社</p>
                <p>出版时间:2023-01-01</p>
                <p>定价: <strong>56.00</strong></p>
                <p>推荐语:本书内容丰富,层次清晰,深入浅出,结合实例,可作为高等学校计算机及相关专业数据结构课程的教材,也可供从事计算机软件开发和应用的工程技术人员阅读和参考.
                </p>
                <button>Buy Now</button>
            </div>
        </div>
    </div>
    <!-- 页脚 -->
    <footer class="footer">
        <center>
            <p>老竹园 All rights reserved. Privacy.| Privacy Policy | Terms of Service</p>
        </center>
    </footer>
</body>
<script>
    document.addEventListener('DOMContentLoaded', function () {
        var dropdown = document.querySelector('.dropdown');
        var dropdownMenu = dropdown.querySelector('.dropdown-menu');

        function toggleDropdown(e) {
            e.stopPropagation(); // 阻止事件冒泡到document点击监听器
            dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
        }

        dropdown.addEventListener('click', toggleDropdown);

        document.addEventListener('click', function (e) {
            if (!dropdown.contains(e.target)) { // 点击区域不在.dropdown内
                dropdownMenu.style.display = 'none';
            }
        });

        // 确保点击.dropdown-menu内的元素不会关闭菜单
        dropdownMenu.addEventListener('click', function (e) {
            e.stopPropagation();
        });
    });
</script>

</html>